package com.springbootbase.springbootproject.mapper;


import com.springbootbase.springbootproject.pojo.RecommendList;
import com.springbootbase.springbootproject.pojo.Recommendation;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.ArrayList;

@Mapper
public interface recommendationMapper {
    @Select("Select * from recommendation where id=#{id}")
    Recommendation getSet(Long id);

    @Update("UPDATE recommendation SET major=#{major},majorRank=#{majorRank},`rank`=#{rank},searchWay=#{searchWay},title=#{title},h_index=#{hIndex}  WHERE id=#{id}")
    void updateSet(Recommendation recommendation);

    @Select("select * from recommendList where studentId=#{id}")
    ArrayList<RecommendList> getStudentList(Long id);
    @Select("select * from recommendList where teacherId=#{id}")
    ArrayList<RecommendList> getTeacherList(Long id);
}
